/**
 * KafkaProducerController.java
 *
 * @author: ZhuJiahui
 * @date: 2018/12/22 0:37
 */
package com.zhujiahui.sbkafka.first;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description:
 * @author: ZhuJiahui
 * @version: 1.0
 */
@RestController
@RequestMapping("kafka")
public class KafkaProducerController {
    @Autowired
    private KafkaTemplate kafkaTemplate;

    @RequestMapping("send")
    public String send(String msg){
        kafkaTemplate.send("sbkafka", msg);
        return "success";
    }
}
